#define NE( nm )
#define DECLNE( nm, fill )  DECL( nm,                                               \
                                  {  gc.nm.easting  = p.e; gc.nm.northing = p.n; }, \
                                  {  p.e = gc.nm.easting; p.n = gc.nm.northing; },  \
                                  fill )

DECL( Geodetic,
  {  gc.Geodetic.longitude = G2Rad( p.gX );
     gc.Geodetic.latitude  = G2Rad( p.gY );
     gc.Geodetic.height    = 0;
},{  p.gX = Rad2G( gc.Geodetic.longitude );
     p.gY = Rad2G( gc.Geodetic.latitude );
},{  gp.Geodetic.height_type = No_Height;
})
DECL( Geocentric,
  {  gc.Geocentric.x      = p.e;
     gc.Geocentric.y      = p.n;
     gc.Geocentric.z      = 0;
},{  p.n = gc.Geocentric.x;
     p.e = gc.Geocentric.y;
},{
})
DECL( UPS,
  {  gc.UPS.easting    = p.e;
     gc.UPS.northing   = Abs(p.n);
     gc.UPS.hemisphere = p.n > 0 ? 'N' : 'S';
},{  p.n = gc.UPS.easting;
     p.e = gc.UPS.northing;
     if ( gc.UPS.hemisphere == 'S' ) p.e = -p.e;
},{
})
DECL( Local_Cartesian,
  {  gc.Local_Cartesian.x = p.e;
     gc.Local_Cartesian.y = p.n;
     gc.Local_Cartesian.z = 0;
},{  p.n = gc.Local_Cartesian.x;
     p.e = gc.Local_Cartesian.y;
},{  if ( pr ) {
       gp.Local_Cartesian.origin_latitude  = pr->origin_latitude;
       gp.Local_Cartesian.origin_longitude = pr->central_meridian;
       gp.Local_Cartesian.origin_height    = pr->height;
       gp.Local_Cartesian.orientation      = 0;
     }
})
DECLNE(Albers_Equal_Area_Conic,
  {  if ( pr ) {
       gp.Albers_Equal_Area_Conic.origin_latitude  = pr->origin_latitude;
       gp.Albers_Equal_Area_Conic.central_meridian = pr->central_meridian;
       gp.Albers_Equal_Area_Conic.std_parallel_1   = pr->std_parallel_1;
       gp.Albers_Equal_Area_Conic.std_parallel_2   = pr->std_parallel_2;
       gp.Albers_Equal_Area_Conic.false_easting    = pr->false_easting;
       gp.Albers_Equal_Area_Conic.false_northing   = pr->false_northing;
     }
})
DECLNE(Azimuthal_Equidistant,
  {  if ( pr ) {
       gp.Azimuthal_Equidistant.origin_latitude  = pr->origin_latitude;
       gp.Azimuthal_Equidistant.central_meridian = pr->central_meridian;
       gp.Azimuthal_Equidistant.false_easting    = pr->false_easting;
       gp.Azimuthal_Equidistant.false_northing   = pr->false_northing;
     }
})

DECLNE(Bonne,
  {  if ( pr ) {
       gp.Bonne.origin_latitude  = pr->origin_latitude;
       gp.Bonne.central_meridian = pr->central_meridian;
       gp.Bonne.false_easting    = pr->false_easting;
       gp.Bonne.false_northing   = pr->false_northing;
     }
})

DECLNE(Cassini,
  {  if ( pr ) {
       gp.Cassini.origin_latitude  = pr->origin_latitude;
       gp.Cassini.central_meridian = pr->central_meridian;
       gp.Cassini.false_easting    = pr->false_easting;
       gp.Cassini.false_northing   = pr->false_northing;
     }
})

DECLNE(Cylindrical_Equal_Area,
  {  if ( pr ) {
       gp.Cylindrical_Equal_Area.origin_latitude  = pr->origin_latitude;
       gp.Cylindrical_Equal_Area.central_meridian = pr->central_meridian;
       gp.Cylindrical_Equal_Area.false_easting    = pr->false_easting;
       gp.Cylindrical_Equal_Area.false_northing   = pr->false_northing;
     }
})

DECLNE(Eckert4,
  {  if ( pr ) {
       gp.Eckert4.central_meridian = pr->central_meridian;
       gp.Eckert4.false_easting    = pr->false_easting;
       gp.Eckert4.false_northing   = pr->false_northing;
     }
})

DECLNE(Eckert6,
  {  if ( pr ) {
       gp.Eckert6.central_meridian = pr->central_meridian;
       gp.Eckert6.false_easting    = pr->false_easting;
       gp.Eckert6.false_northing   = pr->false_northing;
     }
})

DECLNE(Equidistant_Cylindrical,
  {  if ( pr ) {
       gp.Equidistant_Cylindrical.std_parallel     = pr->origin_latitude;
       gp.Equidistant_Cylindrical.central_meridian = pr->central_meridian;
       gp.Equidistant_Cylindrical.false_easting    = pr->false_easting;
       gp.Equidistant_Cylindrical.false_northing   = pr->false_northing;
     }
})

DECLNE(Gnomonic,
  {  if ( pr ) {
       gp.Gnomonic.origin_latitude  = pr->origin_latitude;
       gp.Gnomonic.central_meridian = pr->central_meridian;
       gp.Gnomonic.false_easting    = pr->false_easting;
       gp.Gnomonic.false_northing   = pr->false_northing;
     }
})

DECLNE(Lambert_Conformal_Conic_1,
  {  if ( pr ) {
       gp.Lambert_Conformal_Conic_1.origin_latitude  = pr->origin_latitude;
       gp.Lambert_Conformal_Conic_1.central_meridian = pr->central_meridian;
       gp.Lambert_Conformal_Conic_1.scale_factor     = pr->scale;
       gp.Lambert_Conformal_Conic_1.false_easting    = pr->false_easting;
       gp.Lambert_Conformal_Conic_1.false_northing   = pr->false_northing;
     }
})

DECLNE(Lambert_Conformal_Conic,
  {  if ( pr ) {
       gp.Lambert_Conformal_Conic.origin_latitude  = pr->origin_latitude;
       gp.Lambert_Conformal_Conic.central_meridian = pr->central_meridian;
       gp.Lambert_Conformal_Conic.std_parallel_1   = pr->std_parallel_1;
       gp.Lambert_Conformal_Conic.std_parallel_2   = pr->std_parallel_2;
       gp.Lambert_Conformal_Conic.false_easting    = pr->false_easting;
       gp.Lambert_Conformal_Conic.false_northing   = pr->false_northing;
     }
})

DECLNE( Mercator,
  {  if ( pr ) {
       gp.Mercator.origin_latitude  = pr->origin_latitude;
       gp.Mercator.central_meridian = pr->central_meridian;
       gp.Mercator.scale_factor     = pr->scale;
       gp.Mercator.false_easting    = pr->false_easting;
       gp.Mercator.false_northing   = pr->false_northing;
     }
})
DECLNE( Miller_Cylindrical ,
  {  if ( pr ) {
       gp.Miller_Cylindrical.central_meridian = pr->central_meridian;
       gp.Miller_Cylindrical.false_easting    = pr->false_easting;
       gp.Miller_Cylindrical.false_northing   = pr->false_northing;
     }
})
DECLNE(Mollweide,
  {  if ( pr ) {
       gp.Mollweide.central_meridian = pr->central_meridian;
       gp.Mollweide.false_easting    = pr->false_easting;
       gp.Mollweide.false_northing   = pr->false_northing;
     }
})
DECLNE(Neys,
  {  if ( pr ) {
       gp.Neys.origin_latitude  = pr->origin_latitude;
       gp.Neys.central_meridian = pr->central_meridian;
       gp.Neys.std_parallel_1   = pr->std_parallel_1;
       gp.Neys.false_easting    = pr->false_easting;
       gp.Neys.false_northing   = pr->false_northing;
     }
})
DECLNE(NZMG,
  {
})
DECLNE(Oblique_Mercator,
  {  if ( pr ) {
       gp.Oblique_Mercator.origin_latitude  = pr->origin_latitude;
       gp.Oblique_Mercator.latitude_1       = 0;
       gp.Oblique_Mercator.longitude_1      = 0;
       gp.Oblique_Mercator.latitude_2       = 0;
       gp.Oblique_Mercator.longitude_2      = 0;
       gp.Oblique_Mercator.scale_factor     = pr->scale;
       gp.Oblique_Mercator.false_easting    = pr->false_easting;
       gp.Oblique_Mercator.false_northing   = pr->false_northing;
     }
})
DECLNE(Orthographic,
  {  if ( pr ) {
       gp.Orthographic.origin_latitude  = pr->origin_latitude;
       gp.Orthographic.central_meridian = pr->central_meridian;
       gp.Orthographic.false_easting    = pr->false_easting;
       gp.Orthographic.false_northing   = pr->false_northing;
     }
})
DECLNE(Polar_Stereo,
  {  if ( pr ) {
       gp.Polar_Stereo.latitude_of_true_scale   = pr->origin_latitude;
       gp.Polar_Stereo.longitude_down_from_pole = pr->central_meridian;
       gp.Polar_Stereo.false_easting            = pr->false_easting;
       gp.Polar_Stereo.false_northing           = pr->false_northing;
     }
})
DECLNE(Polyconic,
  {  if ( pr ) {
       gp.Polyconic.origin_latitude  = pr->origin_latitude;
       gp.Polyconic.central_meridian = pr->central_meridian;
       gp.Polyconic.false_easting    = pr->false_easting;
       gp.Polyconic.false_northing   = pr->false_northing;
     }
})
DECLNE(Sinusoidal,
  {  if ( pr ) {
       gp.Sinusoidal.central_meridian = pr->central_meridian;
       gp.Sinusoidal.false_easting    = pr->false_easting;
       gp.Sinusoidal.false_northing   = pr->false_northing;
     }
})
DECLNE(Stereographic,
  {  if ( pr ) {
       gp.Stereographic.origin_latitude  = pr->origin_latitude;
       gp.Stereographic.central_meridian = pr->central_meridian;
       gp.Stereographic.false_easting    = pr->false_easting;
       gp.Stereographic.false_northing   = pr->false_northing;
     }
})
DECLNE(Transverse_Cylindrical_Equal_Area,
  {  if ( pr ) {
       gp.Transverse_Cylindrical_Equal_Area.origin_latitude  = pr->origin_latitude;
       gp.Transverse_Cylindrical_Equal_Area.central_meridian = pr->central_meridian;
       gp.Transverse_Cylindrical_Equal_Area.scale_factor     = pr->scale;
       gp.Transverse_Cylindrical_Equal_Area.false_easting    = pr->false_easting;
       gp.Transverse_Cylindrical_Equal_Area.false_northing   = pr->false_northing;
     }
})
DECLNE(Transverse_Mercator,
  {  if ( pr ) {
       gp.Transverse_Mercator.origin_latitude  = pr->origin_latitude;
       gp.Transverse_Mercator.central_meridian = pr->central_meridian;
       gp.Transverse_Mercator.scale_factor     = pr->scale;
       gp.Transverse_Mercator.false_easting    = pr->false_easting;
       gp.Transverse_Mercator.false_northing   = pr->false_northing;
     }
})
DECLNE(Van_der_Grinten,
  {  if ( pr ) {
       gp.Van_der_Grinten.central_meridian = pr->central_meridian;
       gp.Van_der_Grinten.false_easting    = pr->false_easting;
       gp.Van_der_Grinten.false_northing   = pr->false_northing;
     }
})
